//index.js
// import SignalR from '../../signalr/index'
// import httpClient from '../../signalr/WxOpenHttpClient'
// import wsc from '../../signalr/WxOpenWebSocketTransport'
var SignalR = require('../../signalr/index.js')
var util = require('../../signalr/Utils')

//获取应用实例
const app = getApp()

Page({
  data: {
  
  },
  //事件处理函数
 
  onLoad: function () {
    console.log(util);
    var builder = new SignalR.HubConnectionBuilder();
    var cn = builder.configureLogging(new util.ConsoleLogger(SignalR.LogLevel.Trace)).withUrl('http://localhost:5000/test').build();
    console.log(cn);
    cn.start().then(function(){
      console.log('started');
      cn.invoke('Hello','12345').then(function(rs){
        console.log(rs);
      });
    });
  }
 
})
